<?php

class TicketNameCreate extends CActiveRecordBehavior{

	public function beforeValidate($event) {
		$owner = $this->getOwner();
		if (empty($owner->title))
			$owner->title = LyUtis::cityName(CHtml::value($owner, 'profile.departure_province'))
			.'-'
			.  LyUtis::cityName(CHtml::value($owner, 'profile.arrival_province'));
	}
}

?>